home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / PInterfaces / CTBUtilities.p < prev    next >
Encoding:
Text File  |  1997-08-12  |  5.3 KB  |  209 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CTBUtilities.p
  3.  
  4.      Contains:    Communications Toolbox Utilities interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1988-1993, 1995-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT CTBUtilities;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CTBUTILITIES__}
  28. {$SETC __CTBUTILITIES__ := 1}
  29.  
  30. {$I+}
  31. {$SETC CTBUtilitiesIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {$IFC UNDEFINED __CONDITIONALMACROS__}
  35. {$I ConditionalMacros.p}
  36. {$ENDC}
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {$IFC UNDEFINED __MIXEDMODE__}
  41. {$I MixedMode.p}
  42. {$ENDC}
  43. {$IFC UNDEFINED __DIALOGS__}
  44. {$I Dialogs.p}
  45. {$ENDC}
  46. {$IFC UNDEFINED __APPLETALK__}
  47. {$I AppleTalk.p}
  48. {$ENDC}
  49.  
  50.  
  51. {$PUSH}
  52. {$ALIGN MAC68K}
  53. {$LibExport+}
  54.  
  55.  
  56. CONST
  57.     curCTBUVersion                = 2;                            {  version of Comm Toolbox Utilities }
  58.  
  59.                                                                 {     Error codes/types     }
  60.     ctbuGenericError            = -1;
  61.     ctbuNoErr                    = 0;
  62.  
  63.  
  64. TYPE
  65.     CTBUErr                                = OSErr;
  66.  
  67. CONST
  68.     chooseDisaster                = -2;
  69.     chooseFailed                = -1;
  70.     chooseAborted                = 0;
  71.     chooseOKMinor                = 1;
  72.     chooseOKMajor                = 2;
  73.     chooseCancel                = 3;
  74.  
  75.  
  76. TYPE
  77.     ChooseReturnCode                    = INTEGER;
  78.  
  79. CONST
  80.     nlOk                        = 0;
  81.     nlCancel                    = 1;
  82.     nlEject                        = 2;
  83.  
  84.  
  85. TYPE
  86.     NuLookupReturnCode                    = INTEGER;
  87.  
  88. CONST
  89.     nameInclude                    = 1;
  90.     nameDisable                    = 2;
  91.     nameReject                    = 3;
  92.  
  93.  
  94. TYPE
  95.     NameFilterReturnCode                = INTEGER;
  96.  
  97. CONST
  98.     zoneInclude                    = 1;
  99.     zoneDisable                    = 2;
  100.     zoneReject                    = 3;
  101.  
  102.  
  103. TYPE
  104.     ZoneFilterReturnCode                = INTEGER;
  105.  
  106. CONST
  107.                                                                 {     Values for hookProc items         }
  108.     hookOK                        = 1;
  109.     hookCancel                    = 2;
  110.     hookOutline                    = 3;
  111.     hookTitle                    = 4;
  112.     hookItemList                = 5;
  113.     hookZoneTitle                = 6;
  114.     hookZoneList                = 7;
  115.     hookLine                    = 8;
  116.     hookVersion                    = 9;
  117.     hookReserved1                = 10;
  118.     hookReserved2                = 11;
  119.     hookReserved3                = 12;
  120.     hookReserved4                = 13;                            {     "virtual" hookProc items     }
  121.     hookNull                    = 100;
  122.     hookItemRefresh                = 101;
  123.     hookZoneRefresh                = 102;
  124.     hookEject                    = 103;
  125.     hookPreflight                = 104;
  126.     hookPostflight                = 105;
  127.     hookKeyBase                    = 1000;
  128.  
  129.  
  130. {    NuLookup structures/constants    }
  131.  
  132. TYPE
  133.     NLTypeEntryPtr = ^NLTypeEntry;
  134.     NLTypeEntry = RECORD
  135.         hIcon:                    Handle;
  136.         typeStr:                Str32;
  137.     END;
  138.  
  139.     NLType                                = ARRAY [0..3] OF NLTypeEntry;
  140.     NBPReplyPtr = ^NBPReply;
  141.     NBPReply = RECORD
  142.         theEntity:                EntityName;
  143.         theAddr:                AddrBlock;
  144.     END;
  145.  
  146.     DialogHookProcPtr = ProcPtr;  { FUNCTION DialogHook(item: INTEGER; theDialog: DialogPtr): INTEGER; }
  147.  
  148.     NameFilterProcPtr = ProcPtr;  { FUNCTION NameFilter((CONST)VAR theEntity: EntityName): INTEGER; }
  149.  
  150.     ZoneFilterProcPtr = ProcPtr;  { FUNCTION ZoneFilter(theZone: ConstStr32Param): INTEGER; }
  151.  
  152.     DialogHookUPP = UniversalProcPtr;
  153.     NameFilterUPP = UniversalProcPtr;
  154.     ZoneFilterUPP = UniversalProcPtr;
  155.  
  156. CONST
  157.     uppDialogHookProcInfo = $000003A0;
  158.     uppNameFilterProcInfo = $000000E0;
  159.     uppZoneFilterProcInfo = $000000E0;
  160.  
  161. FUNCTION NewDialogHookProc(userRoutine: DialogHookProcPtr): DialogHookUPP;
  162.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  163.     INLINE $2E9F;
  164.     {$ENDC}
  165.  
  166. FUNCTION NewNameFilterProc(userRoutine: NameFilterProcPtr): NameFilterUPP;
  167.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  168.     INLINE $2E9F;
  169.     {$ENDC}
  170.  
  171. FUNCTION NewZoneFilterProc(userRoutine: ZoneFilterProcPtr): ZoneFilterUPP;
  172.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  173.     INLINE $2E9F;
  174.     {$ENDC}
  175.  
  176. FUNCTION CallDialogHookProc(item: INTEGER; theDialog: DialogPtr; userRoutine: DialogHookUPP): INTEGER;
  177.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  178.     INLINE $205F, $4E90;
  179.     {$ENDC}
  180.  
  181. FUNCTION CallNameFilterProc({CONST}VAR theEntity: EntityName; userRoutine: NameFilterUPP): INTEGER;
  182.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  183.     INLINE $205F, $4E90;
  184.     {$ENDC}
  185.  
  186. FUNCTION CallZoneFilterProc(theZone: ConstStr32Param; userRoutine: ZoneFilterUPP): INTEGER;
  187.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  188.     INLINE $205F, $4E90;
  189.     {$ENDC}
  190. FUNCTION InitCTBUtilities: CTBUErr;
  191. FUNCTION CTBGetCTBVersion: INTEGER;
  192. FUNCTION StandardNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  193. FUNCTION CustomNBP(where: Point; prompt: ConstStr255Param; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  194. {$IFC OLDROUTINENAMES }
  195. FUNCTION NuLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; VAR theReply: NBPReply): INTEGER;
  196. FUNCTION NuPLookup(where: Point; prompt: Str255; numTypes: INTEGER; VAR typeList: NLType; nameFilter: NameFilterUPP; zoneFilter: ZoneFilterUPP; hook: DialogHookUPP; userData: LONGINT; dialogID: INTEGER; filter: ModalFilterUPP; VAR theReply: NBPReply): INTEGER;
  197. {$ENDC}  {OLDROUTINENAMES}
  198.  
  199. {$ALIGN RESET}
  200. {$POP}
  201.  
  202. {$SETC UsingIncludes := CTBUtilitiesIncludes}
  203.  
  204. {$ENDC} {__CTBUTILITIES__}
  205.  
  206. {$IFC NOT UsingIncludes}
  207.  END.
  208. {$ENDC}
  209.